package com.hongkang.springtrains.remoteaccess;

import com.hongkang.springtrains.service.UserService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean;

@Configuration
public class RemoteAccessConfig {
    @Bean
    public HttpInvokerProxyFactoryBean proxyFactoryBean(){
        HttpInvokerProxyFactoryBean factoryBean = new HttpInvokerProxyFactoryBean();
        factoryBean.setServiceUrl("http://localhost:8080/user.service");
        factoryBean.setServiceInterface(UserService.class);
        return factoryBean;
    }

}
